import request from './request';

// 1. 获取商品详情数据
export const reqGoodDetailInfoData = (id) => request.get('/item/' + id)

// 2. 添加选中的商品到购物车页面
// 添加选中的商品到购物车
export const reqAddOrUpdateShopCart = (skuId, skuNum) =>
    request.post(`/cart/addToCart/${skuId}/${skuNum}`);



// 获取购物车数据
export const reqShopCartList = () => request.get("/cart/cartList");

// 切换商品选中状态
export const reqUpdateIsChecked = (skuId, isChecked) =>
    request.get(`/cart/checkCart/${skuId}/${isChecked}`);

// 请求修改购物车所有的选中状态
export const reqUpdateCartListCheckAll = (isChecked, skuIdList) =>
    request.post(`/cart/batchCheckCart/${isChecked}`, skuIdList);

// 删除单个购物车商品
export const reqDeleteOneCartList = (skuId) =>
    request.delete(`/cart/deleteCart/${skuId}`);

// 批量删除多个购物车商品
export const reqDeleteIsCheckCartList = (obj) =>
    request.delete("/cart/batchDeleteCart", obj);



